package buco.core.api;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * Creates a ZIP file that contains all JAR files in the composition. 
 */
public class CreateDeploymentCommand extends Command<Void, File>{

	@Override
	public File execute() throws Exception {
		List<Integer> files = new ArrayList<Integer>(); 
		for(Bundle bundle : composition.getBundles()) {
			files.add(bundle.getFileID()); 
		}
		return fileManager.createDeployment(files);
	}

	@Override
	public boolean canUndo() {
		return false;
	}

}
